-
Notifications
You must be signed in to change notification settings - Fork 0
/
Year 62 - The Sorting Floor
365 lines (364 loc) · 5.77 KB
/
Year 62 - The Sorting Floor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
-- 7 Billion Humans (2214M) --
-- 62: The Sorting Floor by commonnickname --
jump a
mem1 = foreachdir n:
mem2 = foreachdir w:
mem3 = foreachdir e:
mem4 = foreachdir nw:
a:
if mem3 == hole:
step n
step n
b:
mem1 = foreachdir n:
if mem1 != worker:
jump b
endif
endfor
c:
jump d
mem1 = foreachdir n:
d:
if mem1 == worker:
jump c
endif
endfor
mem1 = foreachdir nw:
mem1 = foreachdir nw,n:
endfor
endfor
mem1 = set myitem
if mem2 >= 0:
mem1 = foreachdir nw,sw,n,s,ne,e,se:
mem1 = foreachdir nw,n,ne,e,se:
endfor
endfor
mem1 = set myitem
endif
if mem2 >= 0 or
mem4 >= 0:
mem1 = foreachdir nw:
mem1 = foreachdir nw,n:
mem1 = foreachdir nw,w,n,s,ne,e,se:
endfor
endfor
endfor
if mem2 >= 0 and
mem4 >= 0:
mem1 = set myitem
mem1 = set myitem
endif
endif
tell everyone hi
mem1 = calc [blank] / 0
endif
endfor
endfor
step n
step n
step n
e:
f:
if mem1 == worker:
if mem2 == worker:
jump g
else:
jump h
endif
else:
if mem2 == worker:
jump i
else:
jump j
endif
endif
endfor
endfor
mem2 = foreachdir e:
mem3 = foreachdir s:
mem4 = foreachdir se:
j:
mem1 = nearest datacube
if mem1 <= mem2 and
mem2 <= mem3 and
mem3 <= mem4:
jump k
else:
step mem1
if mem1 <= mem2 and
mem1 <= mem3 and
mem1 <= mem4:
step mem1
pickup c
else:
if mem2 < mem3 or
mem3 > mem4:
if mem2 < mem4:
pickup e
else:
pickup se
endif
else:
if mem2 == mem4 and
mem2 == mem3:
pickup se
else:
pickup s
endif
endif
endif
endif
jump l
endfor
endfor
endfor
mem1 = foreachdir w:
mem3 = foreachdir sw:
mem4 = foreachdir s:
i:
mem2 = nearest datacube
if mem1 <= mem2 and
mem2 <= mem3 and
mem3 <= mem4:
jump m
else:
if mem1 <= mem4 or
mem3 <= mem4 and
mem2 > mem4:
step mem2
if mem1 < mem4 and
mem3 < mem4:
if mem1 <= mem3:
pickup sw
else:
pickup w
endif
else:
pickup s
mem1 = set myitem
endif
else:
if mem1 > mem2 and
mem2 < mem4 and
mem2 < mem3:
if mem1 <= mem3 and
mem1 <= mem4:
pickup w
mem1 = set myitem
else:
if mem3 < mem4:
pickup sw
else:
pickup s
endif
endif
mem1 = set myitem
else:
if mem1 < mem2 or
mem2 > mem4 and
mem2 > mem3:
if mem1 <= mem3 and
mem1 < mem4 or
mem1 > mem2:
pickup sw
mem1 = set myitem
else:
if mem1 <= mem3 or
mem1 < mem4:
pickup w
else:
pickup sw
endif
endif
else:
if mem1 < mem2 and
mem1 > mem4:
pickup w
else:
pickup c
endif
mem1 = set myitem
endif
endif
endif
endif
jump n
endfor
endfor
endfor
mem1 = foreachdir n:
mem2 = foreachdir ne:
mem4 = foreachdir e:
h:
mem3 = nearest datacube
if mem1 <= mem2 and
mem2 <= mem3 and
mem3 <= mem4:
jump o
else:
if mem1 <= mem2 or
mem1 <= mem4 and
mem1 > mem3:
step mem3
if mem1 < mem2 and
mem1 < mem4:
if mem2 <= mem4:
pickup ne
else:
pickup e
endif
else:
mem1 = set myitem
pickup n
endif
else:
if mem1 < mem3 and
mem2 < mem3 and
mem3 > mem4:
if mem1 <= mem4 and
mem2 <= mem4:
mem1 = set myitem
pickup e
else:
if mem1 < mem2:
pickup ne
else:
pickup n
endif
endif
mem1 = set myitem
else:
if mem1 < mem2 and
mem3 >= mem4 or
mem2 <= mem3:
if mem1 <= mem3 or
mem3 >= mem4:
pickup mem3
else:
pickup e
endif
mem1 = set myitem
else:
if mem1 < mem2 and
mem2 <= mem4 or
mem3 >= mem4:
pickup ne
mem1 = set myitem
else:
if mem1 < mem2 or
mem2 <= mem4:
pickup e
else:
pickup ne
endif
endif
endif
endif
endif
endif
jump p
endfor
endfor
endfor
mem1 = foreachdir nw:
mem2 = foreachdir n:
mem3 = foreachdir w:
g:
mem4 = nearest datacube
if mem1 <= mem2 and
mem2 <= mem3 and
mem3 <= mem4:
jump q
else:
step mem4
if mem1 <= mem4 and
mem2 <= mem4 and
mem3 <= mem4:
step mem4
pickup c
else:
if mem1 <= mem2 and
mem2 != mem3 or
mem1 < mem3:
if mem2 < mem3:
pickup w
else:
pickup n
endif
else:
mem1 = set myitem
pickup nw
endif
endif
endif
endfor
endfor
endfor
p:
n:
l:
drop
q:
o:
m:
k:
jump r
mem1 = foreachdir n:
mem2 = foreachdir e:
mem3 = foreachdir s:
mem4 = foreachdir w:
r:
if mem1 == hole or
mem1 == worker and
mem3 == datacube:
if mem2 == hole or
mem2 == worker and
mem4 == datacube:
step s
else:
jump s
endif
else:
if mem2 == hole or
mem2 == worker and
mem4 == datacube:
step nw
else:
step ne
endif
endif
endfor
endfor
endfor
endfor
jump f
mem1 = foreachdir sw:
s:
step e
if mem1 == hole:
jump t
mem1 = foreachdir sw:
mem2 = foreachdir e:
t:
if mem1 < mem2:
pickup sw
step e
drop
endif
step sw
endfor
endfor
else:
mem2 = nearest datacube
if mem1 < mem2:
pickup c
step sw
step w
drop
else:
step sw
endif
endif
endfor
listenfor hi
jump e